abstraction
Class Service

java.lang.Object
  extended by abstraction.Service

public class Service
extends java.lang.Object

This class has methods to get different kind of informations on a service. Constructor takes in input a content's file read using ReadFile Class


Field Summary
private  java.lang.String filename
           
private  java.util.Set<State> finalStates
           
private  State initialState
           
private  boolean isDeterministic
           
private  java.util.HashMap<State,java.util.HashSet<Action>> listAction
           
private  java.util.HashMap<StateAction,java.util.HashSet<State>> nextStates
           
private  java.util.Set<TransitionFunction> transitions
           
 
Constructor Summary
Service(java.lang.String readingFile)
          this constructor takes content's file like string and build a service
 
Method Summary
 boolean containsPresentAction(State presentState, Action action)
          say if exist a pair of state-action
 java.util.Iterator<Action> getActions(State state)
          get all possible action from a present state
 java.util.Iterator<State> getFinalStates()
          get all final states of Service
protected  java.util.Set<State> getFinalStatesSet()
          get all final states of Service
 State getInitialState()
          get initial state
 java.lang.String getName()
          get the service's name
 java.util.Iterator<State> getNextStates(State presentState, Action action)
          get the next states from a state-action
 java.util.Iterator<State> getStates()
          get all states of the service
 java.util.Iterator<TransitionFunction> getTransitionFunctions()
          et all the triples of present state, action and next state stored from the document
protected  java.util.Set<TransitionFunction> getTransitionFunctionsSet()
          get all the triples of present state, action and next state stored from the document
 boolean isDeterministic()
          says if the service is or not deterministic
 boolean isFinalState(State state)
          This method says if a state is final or not
protected  void setName(java.lang.String name)
          set the service's name
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

listAction

private java.util.HashMap<State,java.util.HashSet<Action>> listAction

nextStates

private java.util.HashMap<StateAction,java.util.HashSet<State>> nextStates

finalStates

private java.util.Set<State> finalStates

transitions

private java.util.Set<TransitionFunction> transitions

filename

private java.lang.String filename

initialState

private State initialState

isDeterministic

private boolean isDeterministic
Constructor Detail

Service

public Service(java.lang.String readingFile)
this constructor takes content's file like string and build a service

Method Detail

getTransitionFunctionsSet

protected java.util.Set<TransitionFunction> getTransitionFunctionsSet()
get all the triples of present state, action and next state stored from the document

Returns:
a collection of transition functions

getTransitionFunctions

public java.util.Iterator<TransitionFunction> getTransitionFunctions()
et all the triples of present state, action and next state stored from the document

Returns:
Iterator on transition functions

getFinalStates

public java.util.Iterator<State> getFinalStates()
get all final states of Service

Returns:
Iterator on final states

getFinalStatesSet

protected java.util.Set<State> getFinalStatesSet()
get all final states of Service

Returns:
Set of final states

getStates

public java.util.Iterator<State> getStates()
get all states of the service

Returns:
Iterator on states

isFinalState

public boolean isFinalState(State state)
This method says if a state is final or not

Returns:
boolean. True if state is final, false otherwise

getNextStates

public java.util.Iterator<State> getNextStates(State presentState,
                                               Action action)
get the next states from a state-action

Parameters:
presentState -
action -
Returns:
Iterator on next states

containsPresentAction

public boolean containsPresentAction(State presentState,
                                     Action action)
say if exist a pair of state-action

Parameters:
presentState - to check
action - to check
Returns:
boolean. True if exist pair of present state and action, false otherwise

getActions

public java.util.Iterator<Action> getActions(State state)
get all possible action from a present state

Parameters:
state - from which gets actions
Returns:
Iterator on actions

getInitialState

public State getInitialState()
get initial state

Returns:
State

isDeterministic

public boolean isDeterministic()
says if the service is or not deterministic

Returns:
boolean

getName

public java.lang.String getName()
get the service's name

Returns:
String containing the service's name.

setName

protected void setName(java.lang.String name)
set the service's name

Parameters:
name - of service

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object